<?php
namespace App\Models\Comments;

use Illuminate\Database\Eloquent\Model;

class CommentModel extends model
{
    /**
     * 获取所有留言
     */
    public function getComments($pagenum = 10)
    {
        retrun \App\Comment::select('user_name', 'text', 'comment.create_time')
                ->leftJoin('user', 'user.id', '=', 'comment.uid')
                ->orderBy('create_time', 'desc')
                ->paginate($pagenum);
    }
}
